package org.apache.ocean;

import java.util.concurrent.locks.*;
import java.util.concurrent.atomic.*;
import java.util.*;

/**
 *
 * @author jasonr
 */
public class IDVersionRecord {
  public static final int DELETED = 5;
  public static final int NORMAL = 1;
  public ReentrantLock lock = new ReentrantLock();
  public CLong id;
  public CLong version;
  public TransactionID transactionID;
  public Date dateCreated;
  public Date dateModified;
  public int status;
  public AtomicBoolean inDatabase = new AtomicBoolean();
  
  public IDVersionRecord() { }
  
  public IDVersionRecord(CLong id, CLong version, TransactionID transactionID, Date dateModified, Date dateCreated, int status) {
    this.id = id;
    this.version = version;
    this.transactionID = transactionID;
    this.dateModified = dateModified;
    this.dateCreated = dateCreated;
    this.status = status;
  }
  
  public boolean isDeleted() {
    return status == DELETED;
  }
}
